<%@ page import="java.util.List" %>
<%@ page import="top.huhuiyu.study.javawebjdbc.entity.TbClass" %>
<%@ page import="top.huhuiyu.study.javawebjdbc.dao.TbClassDAO" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>班级列表</title>
</head>
<body>

<%
  List<TbClass> list = TbClassDAO.query();
%>

<h1>
  <a href="insert.jsp">班级添加</a>
</h1>

<table border="1" style="width: 100%;">

  <thead>
    <tr>
      <th>编号</th>
      <th>名称</th>
      <th>简介</th>
      <th>创建时间</th>
      <th>操作</th>
    </tr>
  </thead>

  <tbody>

    <%
      for (TbClass tbClass : list) {
    %>

    <tr>
      <td><%=tbClass.getId()%></td>
      <td><%=tbClass.getClassname()%></td>
      <td><%=tbClass.getClassinfo()%></td>
      <td><%=tbClass.getCreated()%></td>
      <td>
        <a href="delete.jsp?id=<%=tbClass.getId()%>">删除</a>
      </td>
    </tr>

    <% } %>

  </tbody>


</table>


</body>
</html>
